home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Interactive Reference Guide / C-C++ Interactive Reference Guide.iso / c_ref / csource4 / 269_01 / manual2.doc < prev    next >
Text File  |  1987-05-17  |  22KB  |  990 lines

  1.  
  2. E
  3.      Unicorn Library Documentation  3.1                         page 47
  4.  
  5.      __________________________________________________________________
  6.  
  7.                                ellipser
  8. F
  9.      Plots an ellipse on the graphics screen.  The ellipse may be
  10.      rotated in 6 degree increments from 0 to 90 degrees.  To obtain
  11.      full 360 degree rotation the major axis may be defined as either
  12.      x or y with rotation.
  13.  
  14.  
  15.  
  16.      Call:   ellipser(xc, yc, rotate, r1, r2, color);
  17.  
  18.              xc      =  column coordinate of center
  19.              yc      =  row coordinate of center
  20.              rotate  =  angle of rotation (0, 6, 12, 18 etc.)
  21.              r1      =  half the distance along the x-axis (columns)
  22.              r2      =  half the distance along the y axis (rows)
  23.              color   =  color of the ellipse
  24.  
  25.  
  26.  
  27.      Example:    main()
  28.                  {
  29.                    sm(4);  /*  set graphics mode  */
  30.  
  31.                    /* draw an ellipse in color 2 rotated 48 degrees */
  32.  
  33.                    ellipser(100,100,48, 50, 80, 2);
  34.                  }
  35.  
  36.  
  37. Unicorn 1 Documentation  3.1                                      page 48
  38.  
  39. __________________________________________________________________________
  40.  
  41.  
  42.                                equip
  43.  
  44.  
  45. Returns an integer idicative of the equipment contained on the PC.  The
  46. number may be interpreted as follows:
  47.  
  48. bit 0           -  diskette installed
  49. bit 1           -  not used
  50. bit 2, 3        -  always 11
  51. bit 4, 5        -  initial video mode
  52.                      01  =  40 x 25 BW
  53.                      10  =  80 x 25 BW
  54. bit 6, 7        -  number of diskette drives ( only if bit 0 = 1)
  55.                      00 = 1
  56.                      01 = 2
  57. bit 8           -  0 = dma present
  58.                    1 = no dma on system
  59. bit 9, 10, 11   -  number of RS-232 cards installed
  60. bit 12          -  game I/O attached
  61. bit 13          -  not used
  62. bit 14, 15      -  number of printers
  63.  
  64.  
  65.  
  66. Call:         equip();
  67.  
  68.  
  69. Example:      main()
  70.               {
  71.                  equip();  /* get current equipment status */
  72.               }
  73.  
  74.  
  75.  
  76.  
  77. E
  78.      Unicorn Library Documentation  3.1                         page 49
  79.  
  80.      ___________________________________________________________________
  81.  
  82.                               factrl
  83. F
  84.      Returns the factorial of an integer as a double.
  85.  
  86.  
  87.  
  88.  
  89.  
  90.      Call:   factrl(8);
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.      Example:     main()
  98.                   {
  99.                      double a;
  100.                      a =  factrl(21);
  101.                   }
  102.  
  103.  
  104.  
  105. E
  106.      Unicorn Library Documentation  3.1                         page 50
  107.  
  108.      __________________________________________________________________
  109.  
  110.                               fibon
  111. F
  112.      Returns the integer sum of all the integers up to and including
  113.      the passed parameter.
  114.  
  115.  
  116.  
  117.  
  118.  
  119.      Call:   fibon(number);
  120.  
  121.              number  =  ending point of adding numbers
  122.  
  123.  
  124.  
  125.  
  126.  
  127.      Example:     main()
  128.                   {
  129.                      int a;
  130.                      a = fibon(5);
  131.                   }
  132.  
  133.  
  134.  
  135. E
  136.      Unicorn Library Documentation  3.1                         page 51
  137.  
  138.      __________________________________________________________________
  139.  
  140.                                forward
  141. F
  142.      Moves the turtle (turtle graphics) in its current direction by a
  143.      specified distance.  The distance is measured in pixels.
  144.  
  145.  
  146.  
  147.  
  148.      Call:   forward(pixels);
  149.  
  150.              pixels  =  number of pixels to move in current direction
  151.  
  152.  
  153.  
  154.  
  155.      Example:    main()
  156.                  {
  157.                     sm(4);  /* set graphics mode */
  158.                     pendown();  /* set pen down on screen to draw */
  159.                     forward(50);  /* move forward 50 pixels */
  160.                  }
  161.  
  162.  
  163.  
  164.  
  165. E
  166.      Unicorn Library Documentation  3.1                         page 52
  167.  
  168.      __________________________________________________________________
  169.  
  170.                               fpower
  171. F
  172.      Returns fractional powers of doubles.  It works only with positive
  173.      numbers although the power may be negative.
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.      Call:   fpower(number, pow);
  181.  
  182.              number  =  double value to raise to a power
  183.              pow     =  double power
  184.  
  185.  
  186.  
  187.      Example:    main()
  188.                  {
  189.                     fpower(5.67, 2.43);
  190.  
  191.  
  192. Unicorn 1 Documentation  3.1                                      page 53
  193.  
  194. __________________________________________________________________________
  195.  
  196.  
  197.                                getchne
  198.  
  199. Get a character from the standard input with no echo.
  200.  
  201.  
  202.  
  203.  
  204.  
  205. Call:         getchne();
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212. Example:      main()
  213.               {
  214.                  int a;
  215.                  a = getchne(); /* return a character in a with no echo */
  216.               }
  217.  
  218.  
  219.  
  220. Unicorn 1 Documentation  3.1                                      page 54
  221.  
  222. __________________________________________________________________________
  223.  
  224.                                getctype
  225.  
  226.  
  227. Returns an integer indicating the type of IBM-PC.
  228.  
  229. return:
  230.        FFh  =  Original IBM-PC
  231.        FEh  =  PC XT, portable PC or PC with revised system board
  232.        FDh  =  PCjr
  233.        FCh  =  PC-AT
  234.  
  235.  
  236.  
  237. Call:         getctype();
  238.  
  239.  
  240.  
  241. Example:      main()
  242.               {
  243.                  int a;
  244.                  a = getctype();  /* find what type of machine it is */
  245.                  if (a==255)
  246.                    printf("This is an original IBM-PC");
  247.               }
  248.  
  249.  
  250.  
  251. E
  252.      Unicorn Library Documentation  3.1                         page 55
  253.  
  254.      __________________________________________________________________
  255.  
  256.                                getcurp
  257.  
  258. F     This returns the current position of the cursor on the screen in
  259.      row, column format.
  260.  
  261.  
  262.  
  263.  
  264.      Call:    getcurp(&row, &column);
  265.  
  266.               row     =  the current cursor row position
  267.               column  =  the current cursor column position
  268.  
  269.  
  270.  
  271.      Example:   main()
  272.                 {
  273.                    getcurp(row, column);
  274.                 }
  275.  
  276.  
  277. Unicorn 1 Documentation  3.1                                      page 56
  278.  
  279. __________________________________________________________________________
  280.  
  281.                                gliss
  282.  
  283.  
  284. Produces a sliding sound or glissando using the IBM mode of sound
  285. production.
  286.  
  287.  
  288.  
  289.  
  290. Call:         gliss(beg, end, rate);
  291.  
  292.               beg  = starting frequency
  293.               end  = ending frequency
  294.               rate = rate of increase/decrease.  a larger rate slows it down
  295.  
  296.  
  297.  
  298.  
  299. Example:      main()
  300.               {
  301.                  gliss(300, 2000, 1); /* rapid slide from 300 to 2000 cycles*/
  302.                  gliss(2000, 300, 10); /* slower slide down from 2000 to
  303.                                           300 cycles */
  304.               }
  305.  
  306.  
  307.  
  308. E
  309.      Unicorn Library Documentation  3.1                         page 57
  310.  
  311.      __________________________________________________________________
  312.  
  313.                                gothic
  314.  
  315. F     Displays Gothic characters on the graphics screen.  All characters
  316.      are displayed in a 16 pixel wide by 20 pixel high matrix.
  317.  
  318.  
  319.  
  320.      Call:   gothic(char, ulc, ulr, color);
  321.  
  322.              char   =  character to print
  323.              ulc    =  upper left corner column
  324.              ulr    =  upper left corner row
  325.              color  =  color of the character
  326.  
  327.  
  328.  
  329.  
  330.  
  331.      Example:   main()
  332.                 {
  333.                   sm(4);   /*  set graphics mode */
  334.  
  335.                   /*  print a gothic W at 20, 30 in color 3 */
  336.  
  337.                   gothic('W', 20, 30, 3);
  338.                 }
  339.  
  340.  
  341.  
  342. E
  343.      Unicorn Library Documentation  3.1                         page 58
  344.  
  345.      ___________________________________________________________________
  346.  
  347.                               hollow
  348. F
  349.      This function prints outline characters on the graphics screen.  The
  350.      characters are defined in a 16 column by 30 row pixel matrix.
  351.  
  352.  
  353.  
  354.      Call:    hollow(char, ulc, ulr, color);
  355.  
  356.              char   =  character to print
  357.              ulc    =  upper left corner column
  358.              ulr    =  upper left corner row
  359.              color  =  color of the character
  360.  
  361.  
  362.  
  363.  
  364.  
  365.      Example:   main()
  366.                 {
  367.                   sm(4);   /*  set graphics mode */
  368.  
  369.                   /*  print an outline W at 20, 30 in color 3 */
  370.  
  371.                   hollow('W', 20, 30, 3);
  372.                 }
  373.  
  374.  
  375. E
  376.      Unicorn Library Documentation  3.1                         page 59
  377.  
  378.      ___________________________________________________________________
  379.  
  380.                               ifactrl
  381. F
  382.      Returns the integer factorial of an integer.
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.      Call:   ifactrl(number);
  391.  
  392.              number  =  value to use in finding the factorial
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.      Example:      main()
  400.                    {
  401.                       int a;
  402.                       a = ifactrl(23);
  403.                    }
  404.  
  405.  
  406.  
  407. E
  408.      Unicorn Library Documentation  3.1                         page 60
  409.  
  410.      __________________________________________________________________
  411.  
  412.                               indexch
  413.  
  414. F     Returns the position of a character withing a string.
  415.  
  416.  
  417.  
  418.  
  419.  
  420.      Call:   indexch(str, ch);
  421.  
  422.              str  =  string to be searched
  423.              ch   =  character to search for
  424.  
  425.  
  426.  
  427.      Example:    main()
  428.                  {
  429.                      /*  find the position of the character 'i' */
  430.                      /*  should return a 2 */
  431.                      indexch("This is a test", 'i');
  432.                  }
  433.  
  434.  
  435.  
  436. E
  437.      Unicorn Library Documentation  3.1                         page 61
  438.  
  439.      __________________________________________________________________
  440.  
  441.                               indexr
  442.  
  443. F     Returns the rightmost position of a character in a given string.
  444.      Returns -1 if the character is not found in the string.
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.      Call:   indexr(str, ch);
  452.  
  453.              str  =  string to be searched
  454.              ch   =  character to search for
  455.  
  456.  
  457.  
  458.  
  459.      Example:    main()
  460.                  {
  461.                     /* find the rightmost poistion of 'i' in "this is a
  462.                        test".  Should return 5  */
  463.                     indexr("This is a test", 'i');
  464.                  }
  465.  
  466.  
  467.  
  468.  
  469. E
  470.      Unicorn Library Documentation  3.1                         page 62
  471.  
  472.      ___________________________________________________________________
  473.  
  474.                                lfactrl
  475. F
  476.      Returns a long integer factorial of a number.
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.      Call:   lfactrl(number);
  485.  
  486.              number  =  integer value used in finding the factorial
  487.  
  488.  
  489.  
  490.  
  491.  
  492.      Example:     main()
  493.                   {
  494.                      long a;
  495.                      a = lfactrl(54);
  496.                   }
  497.  
  498.  
  499.  
  500. E
  501.      Unicorn Library Documentation  3.1                         page 63
  502.  
  503.      __________________________________________________________________
  504.  
  505.                                lgstr
  506.  
  507. F     This function uses the ROM internal dot character descriptions to
  508.      place a magnified character string on the graphics screen.
  509.  
  510.  
  511.  
  512.  
  513.      Call:   lgstr(string, ulc, ulr, hmag, vmag, color);
  514.  
  515.              string  =  string to print
  516.              ulc     =  upper left corner column
  517.              ulr     =  upper left corner row
  518.              hmag    =  horizontal magnification
  519.              vmag    =  vertical magnification
  520.              color   =  color of character
  521.  
  522.  
  523.      Example:   main()
  524.                 {
  525.                    sm(4);  /*  set graphics mode  */
  526.  
  527.                    /*  print the string "Test" double sized in color 1  */
  528.  
  529.                    lgstr("Test", 10, 40, 2, 2, 1);
  530.                 }
  531.  
  532.  
  533. E
  534.      Unicorn Library Documentation  3.1                         page 64
  535.  
  536.      __________________________________________________________________
  537.  
  538.                                line
  539.  
  540. F     Draws a line on the graphics screen given the two endpoints and
  541.      the color.
  542.  
  543.  
  544.  
  545.  
  546.      Call:    line(x1, y1, x2, y2, color);
  547.  
  548.               x1, y1  =  end point coordinates
  549.               x2, y2  =  second end point coordinates
  550.               color   =  color of the line
  551.  
  552.  
  553.      Example:   main()
  554.                 {
  555.                    sm(4);  /*  set the graphics mode  */
  556.  
  557.                    /*  draw a line in color 3 from 30,50 to 180, 140 */
  558.  
  559.                    line(30,50,180,140,3);
  560.                 }
  561.  
  562.  
  563. E
  564.      Unicorn Library Documentation  3.1                         page 65
  565.  
  566.      __________________________________________________________________
  567.  
  568.                                locate
  569.  
  570. F     Returns the color of a pixel on the graphics screen.
  571.  
  572.  
  573.  
  574.  
  575.      Call:  variable = locate(row, column);
  576.  
  577.             variable  =  the return variable
  578.             row       =  the row of the pixel
  579.             column    =  the column of the pixel
  580.  
  581.  
  582.  
  583.  
  584.      Example:   main()
  585.                 {
  586.                    int a;
  587.                    sm(4);  /*  set graphics mode  */
  588.  
  589.                    /* find the color of the pixel located at 100, 110 */
  590.                    a = locate(100,110);
  591.                    /* print it out */
  592.                    printf("The color of the pixel at 100, 110 is %d\n", a);
  593.                 }
  594.  
  595.  
  596. Unicorn 1 Documentation  3.1                                      page 66
  597.  
  598. __________________________________________________________________________
  599.  
  600.                                lprintf
  601.  
  602.  
  603. Send a string to line printer 1.
  604.  
  605.  
  606.  
  607.  
  608.  
  609. Call:         lprintf(string);
  610.  
  611.               string = a pointer to string to be printed on printer
  612.  
  613.  
  614.  
  615.  
  616. Example:      main()
  617.               {
  618.                  lprintf("This is a test"); /* send string to printer */
  619.               }
  620.  
  621.  
  622.  
  623. Unicorn 1 Documentation  3.1                                      page 67
  624.  
  625. __________________________________________________________________________
  626.  
  627.  
  628.                               lputch
  629.  
  630.  
  631. This function prints a single character to the printer.  It is limited to
  632. supporting only line printer #1.
  633.  
  634.  
  635.  
  636. Call:         lputch(char);
  637.  
  638.               char  =  the character to be printed.
  639.  
  640. Return:       printer status
  641.                  bit 0 = timeout occurred
  642.                  bit 1 = [unused]
  643.                  bit 2 = [unused]
  644.                  bit 3 = I/O error
  645.                  bit 4 = selected
  646.                  bit 5 = out of paper
  647.                  bit 6 = acknowledge
  648.                  bit 7 = not busy
  649.  
  650.  
  651. Example:      main()
  652.               {
  653.                  char a;
  654.  
  655.                  a = 'x';
  656.                  lputch(a);      /* print the letter 'x' on the printer */
  657.                                  /*  at the current print head location */
  658.               }
  659.  
  660.  
  661. Unicorn 1 Documentation  3.1                                      page 68
  662.  
  663. __________________________________________________________________________
  664.  
  665.  
  666.                               memsize
  667.  
  668.  
  669. Returns an integer containing the number of kilobytes of memory installed.
  670.  
  671.  
  672.  
  673.  
  674. Call:         memsize();
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681. Example:      main()
  682.               {
  683.                  int a;
  684.                  a = memsize(); /* get kilobytes of memory */
  685.               }
  686.  
  687.  
  688. E
  689.      Unicorn Library Documentation  3.1                         page 69
  690.  
  691.      __________________________________________________________________
  692.  
  693.                                moveto
  694.  
  695. F     Moves the turtle pen to an absolute pixel location without
  696.      drawing.
  697.  
  698.  
  699.  
  700.  
  701.  
  702.      Call:   moveto(col, row);
  703.  
  704.              col  =  the new column coordinate
  705.              row  =  the new row coordinate
  706.  
  707.  
  708.  
  709.      Example:   main()
  710.                 {
  711.                    sm(4);  /* set the graphics mode  */
  712.  
  713.                    /*  move the turtle pen to 100, 30 */
  714.                    moveto(100, 30);
  715.                  }
  716.  
  717.  
  718. E
  719.      Unicorn Library Documentation  3.1                         page 70
  720.  
  721.      __________________________________________________________________
  722.  
  723.                                note
  724.  
  725. F                         Tandy 1000 only
  726.  
  727.      Plays a musical tone on the internal speaker.  This function
  728.      includes all sharps and flats and a total of 7 octaves.  The user
  729.      is given access to all three voices and full control over the
  730.      volume.
  731.      Future versions will include duration for added control over the
  732.      note.
  733.  
  734.  
  735.  
  736.  
  737.      Call:   note(voice, octave, note, volume);
  738.  
  739.              voice   =  1, 2, or 3 ( selects sound channel)
  740.              octave  =  1 - 7 with 1 being the lowest
  741.              note    =  note from below table
  742.              volume  =  0 (off) to 15 (loudest)
  743.  
  744.              A  - 1      octave 3 contains middle C
  745.              A# - 2
  746.              B  - 3
  747.              C  - 4
  748.              C# - 5
  749.              D  - 6
  750.              D# - 7
  751.              E  - 8
  752.              F  - 9
  753.              G  - 10
  754.              G# - 11
  755.  
  756.  
  757. E
  758.      Unicorn Library Documentation  3.1                         page 71
  759.  
  760.      __________________________________________________________________
  761.  
  762.                                paint
  763.  
  764. F     Fills an area containing a seed point and bounded by a single color
  765.      with a specified color.
  766.  
  767.  
  768.  
  769.  
  770.  
  771.      Call:   paint(column, row, paintc, boundry);
  772.  
  773.              column   =  column coordinate of seed point inside boundry
  774.              row      =  row coordinate of seed point inside boundry
  775.              paintc   =  color to paint the enclosed region
  776.              boundry  =  color of the boundry to the region to fill
  777.  
  778.  
  779.  
  780.  
  781.  
  782.      Example:   main()
  783.                 {
  784.                    sm(4);  /* set graphics mode  */
  785.                    /* draw a circle */
  786.                    circle(100,100,50,1,1,3);
  787.                    /* paint the circle (watch the border color! */
  788.                    paint(100,100,2,3);
  789.                 }
  790.  
  791.  
  792. E
  793.      Unicorn Library Documentation  3.1                         page 72
  794.  
  795.      __________________________________________________________________
  796.  
  797.                                palette
  798.  
  799. F                             IBM-PC only
  800.  
  801.      Changes the palette or color set to be used on an IBM-PC.
  802.  
  803.  
  804.  
  805.  
  806.  
  807.      Call:   palette(a, b, c);
  808.  
  809.              a  =  the palette number (0 to 3)
  810.              b  =  mode ( 4-normal,  5- extra or highlighted color sets)
  811.              c  =  background color
  812.  
  813.  
  814.  
  815.      Example:  main()
  816.                {
  817.                   sm(4);  /* set the graphics mode */
  818.                   /* set the color set to highlighted palette 2 with a
  819.                      blue background.                                 */
  820.                   palette(2, 5, 1);
  821.                }
  822.  
  823.  
  824. E
  825.      Unicorn Library Documentation  3.1                         page 73
  826.  
  827.      __________________________________________________________________
  828.  
  829.                                pencolor
  830.  
  831. F     Sets the turtle graphics pen color.
  832.  
  833.  
  834.  
  835.  
  836.  
  837.  
  838.  
  839.      Call:    pencolor(color);
  840.  
  841.               color  =  the pen color to use.  may be 0-3 for IBM or
  842.                         0-16 for Tandy 1000
  843.  
  844.  
  845.  
  846.      Example:   main()
  847.                 {
  848.                    sm(4);  /*  set graphics mode  */
  849.                    /* change pen color to 3 */
  850.                    pencolor(3);
  851.                 }
  852.  
  853.  
  854. E
  855.      Unicorn Library Documentation  3.1                         page 74
  856.  
  857.      __________________________________________________________________
  858.  
  859.                                pendown
  860.  
  861. F      Places the turtle graphics "pen down" on the screen so that it
  862.      may draw.
  863.  
  864.  
  865.  
  866.  
  867.  
  868.      Call:   pendown();
  869.  
  870.  
  871.  
  872.  
  873.  
  874.      Example:   main()
  875.                 {
  876.                    sm(4);  /*  set the graphics mode */
  877.                    /* place the pen down in preperation for drawing */
  878.                    pendown();
  879.                 }
  880.  
  881. E
  882.      Unicorn Library Documentation  3.1                         page 75
  883.  
  884.      __________________________________________________________________
  885.  
  886.                                penup
  887.  
  888. F     Lift the pen up so that it may be moved without drawing.
  889.  
  890.  
  891.  
  892.  
  893.  
  894.      Call:  penup();
  895.  
  896.  
  897.  
  898.  
  899.  
  900.      Example:   main()
  901.                 {
  902.                    sm(4);  /* set the graphics mode  */
  903.                    /* lift up the pen */
  904.                    penup();
  905.                 }
  906.  
  907.  
  908. Unicorn 1 Documentation  3.1                                      page 76
  909.  
  910. __________________________________________________________________________
  911.  
  912.  
  913.                               phasor
  914.  
  915.  
  916. Make a phasor sound.
  917.  
  918.  
  919.  
  920.  
  921.  
  922. Call:         phasor();
  923.  
  924.  
  925.  
  926.  
  927. Example:      main()
  928.               {
  929.                  phasor(); /* make phasor sound */
  930.               }
  931.  
  932.  
  933.  
  934. E
  935.      Unicorn Library Documentation  3.1                         page 77
  936.  
  937.      __________________________________________________________________
  938.  
  939.                                point
  940.  
  941. F     Light up a single pixel in a specified color.
  942.  
  943.  
  944.  
  945.  
  946.      Call:  point(column, row, color);
  947.  
  948.             column  =  the pixel column
  949.             row     =  the pixel row
  950.             color   =  color to light the pixel
  951.  
  952.  
  953.  
  954.      Example:    main()
  955.                  {
  956.                     sm(4);  /*  set the graphics mode  */
  957.                     /*  light the pixel at 110,110 in color 3 */
  958.                     point(110, 110, 3);
  959.                  }
  960.  
  961.  
  962.  
  963. E
  964.      Unicorn Library Documentation  3.1                         page 78
  965.  
  966.      __________________________________________________________________
  967.  
  968.                               power
  969. F
  970.      Raise a number to a power.  The number is a float but the power
  971.      must be an integer.
  972.  
  973.  
  974.  
  975.  
  976.      Call:   power(number, pow);
  977.  
  978.              number  =  floating point value to take to a power
  979.              pow     =  integer power
  980.  
  981.  
  982.  
  983.  
  984.      Example:    main()
  985.                  {
  986.                     power(6.78, 3);
  987.                  }
  988.  
  989.  
  990.